<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

<ui:define name="head">
    <style type="text/css">
        .input-col-m {
            width: 60px;
        }

        .input-col-l {
            width: 80px;
        }

        .input-col-xxl {
            width: 1%;
            text-align: right;
        }

        .col-95 {
            text-align: right;
        }

        .col-5 {
            text-align: left;
        }
    </style>
    <script type="text/javascript" language="javascript">
//        window.onload() = function tell
        document.onkeydown = function TabReplace() {
            if (event.keyCode == 13) {
                if (event.srcElement.tagName != 'BUTTON')
                    event.keyCode = 9;
                else
                    event.srcElement.click();
            }
        }

        function closeThisWindow(rtnflag) {
            if (rtnflag == "true") {
                window.returnValue = "1";
                window.close();
            }
        }
    </script>

</ui:define>

<ui:define name="content">
    <div style="margin:5px;">
        <p:growl id="msgs" showDetail="false"/>
        <h:form id="form">
            <h:outputText id="jscript" escape="false" value="#{cbusPayoutExecAction.jscript}"/>
            <p:panel id="input" header="【实际用款】记录信息">
                <h:panelGrid columns="1" cellspacing="2" style="width: 100%">
                    <h:panelGrid columns="1" cellspacing="2" style="width: 100%">

                        <p:fieldset legend="用款计划">
                            <h:panelGrid columns="1">
                                <h:panelGrid columns="4" cellpadding="2" columnClasses="col-95,col-5,col-95,col-5"
                                             style="width: 100%">
                                    <h:outputLabel value="计划编号:" for="planNo" style="margin-left: 28px;"/>
                                    <p:inputText id="planNo" value="#{cbusPayoutExecAction.rsPayout.businessNo}"
                                                 readonly="true" style="width:160px;"/>
                                    <h:outputLabel value="计划金额:" for="planAmt" style="margin-left: 30px;"/>
                                    <p:inputText id="planAmt" value="#{cbusPayoutExecAction.planCtrl.plAmount}"
                                                 readonly="true" style="width:160px;">
                                        <f:convertNumber pattern="#,###,###,###,##0.00"/>
                                    </p:inputText>
                                </h:panelGrid>
                            </h:panelGrid>
                        </p:fieldset>

                        <p:fieldset legend="收款方信息">
                            <h:panelGrid columns="1">
                                <h:panelGrid columns="4" cellpadding="2" columnClasses="col-95,col-5,col-95,col-5"
                                             style="width: 100%">
                                    <h:outputLabel value="收款方账号:" for="toAccountCode" style="margin-left: 16px;"/>
                                    <p:inputText id="toAccountCode"
                                                 value="#{cbusPayoutExecAction.rsPayout.recAccount}"
                                                 readonly="true" style="width:160px;"/>
                                    <h:outputLabel value="收款方户名:" for="toAccountName" style="margin-left: 17px;"/>
                                    <p:inputText id="toAccountName"
                                                 value="#{cbusPayoutExecAction.rsPayout.recCompanyName}"
                                                 readonly="true" style="width:260px;"/>

                                    <h:outputLabel value="收款行:" for="toBankCode" style="margin-left: 16px;"/>
                                    <p:inputText id="toBankCode"
                                                 value="#{cbusPayoutExecAction.rsPayout.recBankCode}"
                                                 readonly="true" style="width:160px;"/>
                                    <h:outputLabel value="收款行全称:" for="toBankName" style="margin-left: 17px;"/>
                                    <p:inputText id="toBankName"
                                                 value="#{cbusPayoutExecAction.rsPayout.recBankName}"
                                                 readonly="true" style="width:260px;"/>
                                </h:panelGrid>

                            </h:panelGrid>
                        </p:fieldset>
                        <p:fieldset legend="付款方信息">
                            <h:panelGrid columns="1">
                                <h:panelGrid columns="4" cellspacing="2" style="width: 100%"
                                             columnClasses="col-95,col-5,col-95,col-5">

                                    <h:outputLabel value="付款房产商:" for="companyName" style="margin-left:20px;"/>
                                    <h:inputText autocomplete="off" id="companyName" style="width:160px;"
                                                 readonly="true"
                                                 value="#{cbusPayoutExecAction.rsPayout.payCompanyName}">
                                    </h:inputText>

                                    <h:outputLabel value="付款监管账号:" for="accountCode"/>
                                    <p:inputText autocomplete="off" id="accountCode" style="width:160px;"
                                                 readonly="true"
                                                 value="#{cbusPayoutExecAction.rsPayout.payAccount}">
                                    </p:inputText>

                                    <h:outputLabel value="凭证号:" for="docNo"/>
                                    <p:inputText id="docNo" value="#{cbusPayoutExecAction.rsPayout.docNo}"
                                                 readonly="true"
                                                 style="width:160px;"/>

                                    <h:outputLabel value="申请金额:" for="applyAmt" style="margin-left:20px"/>
                                    <p:inputText autocomplete="off" id="applyAmt" style="width:160px;"
                                                 readonly="true" value="#{cbusPayoutExecAction.rsPayout.plAmount}">
                                        <f:convertNumber pattern="#,###,###,###,##0.00"/>
                                    </p:inputText>

                                    <h:outputLabel value="申请人:" for="applyPerson"/>
                                    <p:inputText autocomplete="off" id="applyPerson" style="width:160px;"
                                                 readonly="true"
                                                 value="#{cbusPayoutExecAction.rsPayout.applyUserName}">
                                    </p:inputText>

                                    <h:outputLabel value="申请时间:" for="applyDate"/>
                                    <p:inputText autocomplete="off" id="applyDate" style="width:160px;"
                                                 readonly="true" value="#{cbusPayoutExecAction.rsPayout.applyDate}">
                                    </p:inputText>

                                    <h:outputLabel value="审核人:" for="auditPerson"/>
                                    <p:inputText autocomplete="off" id="auditPerson" style="width:160px;"
                                                 readonly="true"
                                                 value="#{cbusPayoutExecAction.rsPayout.auditUserName}">
                                    </p:inputText>

                                    <h:outputLabel value="审核时间:" for="auditDate"/>
                                    <p:inputText autocomplete="off" id="auditDate" style="width:160px;"
                                                 readonly="true" value="#{cbusPayoutExecAction.rsPayout.auditDate}">
                                    </p:inputText>

                                </h:panelGrid>
                                <h:panelGrid columns="2" cellspacing="2" style="width: 100%"
                                             columnClasses="col-95,col-5">

                                    <h:outputLabel value="申请事由:" for="applyReason"
                                                   style="text-align: right;margin-left: 33px;"/>
                                    <p:inputText autocomplete="off" id="applyReason" style="width:425px;"
                                                 readonly="true" value="#{cbusPayoutExecAction.rsPayout.purpose}">
                                    </p:inputText>

                                    <h:outputLabel/><p:separator/>

                                    <h:outputLabel/>
                                    <h:panelGroup>
                                        <h:outputLabel value="状态标志:" for="statusFlag"/>
                                        <h:outputText id="statusFlag"
                                                      value="#{cbusPayoutExecAction.statusFlag.valueOfAlias(cbusPayoutExecAction.rsPayout.statusFlag).title}"
                                                      readonly="true" style="width:160px;"/>
                                        <h:outputLabel/>
                                        <h:outputLabel value="处理结果:" for="workResult"/>
                                        <h:outputText id="workResult"
                                                      value="#{cbusPayoutExecAction.workResult.valueOfAlias(cbusPayoutExecAction.rsPayout.workResult).title}"
                                                      readonly="true" style="width:160px;"/>
                                    </h:panelGroup>
                                </h:panelGrid>
                            </h:panelGrid>
                        </p:fieldset>
                    </h:panelGrid>
                    <h:panelGroup>
                        <p:separator/>
                        <p:ajaxStatus style="height:18px;text-align:center">
                            <f:facet name="start">
                                <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                                <br/>
                                <h:outputLabel value="系统正在入账，请稍候..." style="color: #fcd147;"/>
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value=""/>
                            </f:facet>
                        </p:ajaxStatus>
                    </h:panelGroup>
                    <br/>
                    <h:panelGrid style="width: 20%" columns="2">
                        <p:commandButton id="saveBtn" ajax="true" value="确认入账"
                                         action="#{cbusPayoutExecAction.onExecute}"
                                         style="margin-left:235px;width:90px"
                                         update="input,pdt,msgs">
                        </p:commandButton>
                        <p:commandButton id="directPrint" ajax="false" value="打印凭证"
                                         actionListener="#{cbusPayoutExecAction.onPrintVoucher}"
                                         style="margin-left:10px;width:90px;"/>
                    </h:panelGrid>

                </h:panelGrid>
            </p:panel>
        </h:form>
    </div>
</ui:define>

</ui:composition>